<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		ul li:only-child {
			color: red;
		}
	</style>
</head>
<body>
	<ul>
		<li>这是only-child选择器测试</li>
		<!-- <p>这是段落</p> -->
	</ul>

	<ul>
		<li>这是only-child选择器测试1</li>
		<li>这是only-child选择器测试2</li>
	</ul>
</body>
</html>